home *** CD-ROM | disk | FTP | other *** search
/ BBS Toolkit / BBS Toolkit.iso / doors_1 / jpdoor32.zip / JPDOOR.DOC < prev    next >
Text File  |  1992-02-26  |  37KB  |  915 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.   
  15.              ┌──────────────────────────────────────────────┐
  16.              │             MOTOR CITY SOFTWARE              │
  17.              │   ┌──────────────────────────────────────┐   │
  18.              │   │       JPDoor - Version 3.1 SE        │   │
  19.              │   │            ┌──────────┐              │   │
  20.              │   │            │\         │              │   │
  21.              │   │            │ \        │              │   │
  22.              │   │            │  \   P   │              │   │
  23.              │   │            │   \  A   │              │   │
  24.              │   │            │   │  S   │              │   │
  25.              │   │            │   │  C   │              │   │
  26.              │   │     5.5    │   │  A   │    6.0       │   │
  27.              │   │            │  o│  L   │              │   │
  28.              │   │            │   │      │              │   │
  29.              │   │            \   │──────┘              │   │
  30.              │   │             \  │                     │   │
  31.              │   └──────────────\ │─────────────────────┘   │
  32.              │      The Ultimate \│ Door Writing Unit.      │
  33.              └────────────────────┴─────────────────────────┘
  34.  
  35.  
  36.  
  37.                           JPDoor - Version 3.1 SE
  38.                Copyright 1990,1991,1992 by Motor City Software.
  39.                             All Rights Reserved
  40.  
  41.   
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.                J P D O O R    D O C U M E N T A T I O N
  63.  
  64.  
  65. ╒════════════════════════════════════════════════════════════════════════════╕
  66. │░░░░░ TABLE OF CONTENTS ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░│
  67. ╘════════════════════════════════════════════════════════════════════════════╛
  68.  
  69.  
  70.  
  71.           Motor City Software .............................  3
  72.  
  73.           Licensing Information  ..........................  4
  74.  
  75.           Support Systems .................................  4
  76.  
  77.           Acknowledgements  ...............................  5
  78.  
  79.           Getting Started With JPDoor   
  80.  
  81.                The Uses Statement  ........................  6
  82.  
  83.                Trapping Halt Codes  .......................  6
  84.  
  85.                Trapping Extended Keys  ....................  9
  86.  
  87.                Getting the User Information  .............. 12
  88.  
  89.                Initializing the Fossil Driver  ............ 13
  90.  
  91.                Initializing ANSI Color Sequences  ......... 14
  92.  
  93.                The Status Bar  ............................ 14
  94.  
  95.                Fossil Output Buffering  ................... 15
  96.  
  97.  
  98.  
  99.           JPDoor Reference Section .................. See File JPDOOR.REF
  100.                                                               
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.                                                         [2] JPDoor 3.1.Doc
  120.  
  121.  
  122.  
  123.  
  124. ╒═════════════════════════════════════════════════════════════════════════════╕
  125. │░░░░░░ MOTOR CITY SOFTWARE ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░│
  126. ╘═════════════════════════════════════════════════════════════════════════════╛
  127.  
  128.  
  129.  
  130.       Motor City Software is a Shareware Programming Partnership composed
  131.  of four different Programmers, which each bring their own special talents
  132.  to this unique partnership:
  133.  
  134.  
  135.  
  136.                            
  137. Rod Hancock         John Parlin       Jeff Wilson         Peter Kling
  138. Oshawa Ontario      Hopkins MN        Bowmanville Ont     Albany NY
  139. CANADA              USA               CANADA              USA
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.                                                         [3] JPDoor 3.1.Doc
  180.  
  181.  
  182. ╒═════════════════════════════════════════════════════════════════════════════╕
  183. │░░░░░░ LICENSING INFORMATION ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░│
  184. ╘═════════════════════════════════════════════════════════════════════════════╛
  185.  
  186.      This program is not Freeware.  This is SHAREWARE which means it is user-
  187. supported software.  If you use this program for more than 30 days, you are
  188. required to register or remove it from your system.  The registration fee is
  189. a mere $30.00 and is not a lot to ask considering the time and effort required
  190. for a toolkit of this nature.
  191.  
  192.      JPDOOR is Copyright 1990,1991,1992 by Motor City Software and all rights
  193. are reserved.  You may copy this program and documentation for backup purposes.
  194. You also may copy and share UNMODIFIED copies of the program package, pro-
  195. viding that the copyright notice is reproduced and included on all copies.
  196.  
  197.  
  198.      You may not sell the product for a fee and/or distribute the product
  199. along with other products without expressed written permission from Motor
  200. City Software, nor may you modify or remove the Copyright Notice from the
  201. program or the documentation.
  202.  
  203.      You may not distribute programs which you have created using JPDoor 
  204. without first registering JPDoor with the author.  You may not accept com-
  205. pensation for programs created using JPDoor without registering JPDoor with
  206. the authors.
  207.  
  208.      This unit was written to aid programmers in writing RemoteAccess 0.01 
  209. thru 1.11 and QuickBBS 2.62 thru 2.75 compatible door programs using Turbo
  210. Pascal* 5.5 and Turbo Pascal* 6.0.
  211.  
  212.      Use of this product constitutes acceptance of these terms.
  213.  
  214. ╒═════════════════════════════════════════════════════════════════════════════╕
  215. │░░░░░░ SUPPORT SYSTEMS ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░│
  216. ╘═════════════════════════════════════════════════════════════════════════════╛
  217.  
  218.  
  219. If you have any comments, suggestions or bug reports please address them to
  220. Rod Hancock at FidoNet 1:229/418.  For additional support or the latest files
  221. a list of the Motor City Software Support Systems is included in this archive
  222. as SUPPORT.LST
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.                                                         [4] JPDoor 3.1.Doc
  241.  
  242.  
  243. ╒═════════════════════════════════════════════════════════════════════════════╕
  244. │░░░░░░ ACKNOWLEDGEMENTS ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░│
  245. ╘═════════════════════════════════════════════════════════════════════════════╛
  246.  
  247.  
  248.     The release of JPDoor has been a cooperative effort.  Our sincere 
  249.  gratitude goes out to those who helped with the development of one of the
  250.  most popular Door Writing Toolkits available.
  251.  The contributors towards past versions were:
  252.  
  253.      - Cary Howell, QuickAccess BBS (1:379/207), The Manhatten Project
  254.  
  255.        Cary really added a lot to the code providing us with the status bar,
  256.        text file control codes, screen handling, and other enhancements to
  257.        existing blocks of code.
  258.  
  259.      - Scott Davis, Phoenix Starfighter BBS (1:3616/20)
  260.  
  261.        Scott provided his assistance whenever I asked for it and volunteered
  262.        even more.  Thanks to Scott, we now have the ability to trap extended
  263.        keys from the local console or the remote.  Scott contributed in many
  264.        areas and has helped to keep JPDoor compatible with QuickBBS 2.64
  265.        systems.  Scott also enhanced the unit by combining ShowAnsiFile and
  266.        ShowTextFile to make one procedure called ShowFile.
  267.  
  268.      - Mark Cook, Wizardry BBS (1:104/630)
  269.  
  270.        Mark provided us with the initial idea of far calls in JPDoor so that
  271.        we could trap unexpected exits.  Some of Mark's TRAPEXIT.PAS code is
  272.        still included in this release.
  273.  
  274.      - Robert Van Hoeven and Tom Ordelman of European Cybernetics
  275.  
  276.        Robert optimized the code and cleaned up some of my not-so-pretty 
  277.        stuff for release 2.4c.  Tom coordinated the effort.  Thanks to these 
  278.        two, we can read the code again!
  279.  
  280.  
  281.      - Peter Kling of The Computer Group Ltd (1:267/169.0).
  282.  
  283.        Peter provided some enhancements to make the error handling
  284.        procedures more readable for the user and the sysop.  The
  285.        error handling code had been imported directly from Packer.      
  286.  
  287.      - Andrew Milner & Continental Software for unlimited support
  288.        and a great BBS package without which some of the new features
  289.        of JPDoor would not be possible.
  290.  
  291.      - A special thanks to all the beta testers for all the suggestions
  292.        and help in ironing out the bugs.
  293.  
  294.   And a big thanks to all the users out there who have shown an interest 
  295.   in this product.  Your support is what generates new releases.  Program
  296.   updates will continue to be made as long as there is user support in the
  297.   form of product registrations.
  298.  
  299.       (* Turbo Pascal is trademarked by Borland International, Inc.)
  300.  
  301.  
  302.  
  303.  
  304.                                                         [5] JPDoor 3.1.Doc
  305.   
  306.  
  307. ╒═════════════════════════════════════════════════════════════════════════════╕
  308. │░░░░░░ GETTING STARTED WITH JPDOOR ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░│
  309. ╘═════════════════════════════════════════════════════════════════════════════╛
  310.  
  311.  
  312.  
  313. The USES statement:
  314. -------------------
  315.  
  316.      To use JPDoor with your door program, you'll need to put it into your 
  317.   USES statement:
  318.  
  319.             USES DOS, CRT, JPDoor31 ;
  320.  
  321.             code segment:
  322.  
  323.  --------------------------------------------------------------------------
  324. |                PROGRAM MyDoorProgram ;                                   |
  325. |                USES DOS, CRT, JPDoor31 ;                                 |
  326. |                .....                                                     |
  327. |                ...                                                       |
  328. |                {your program continues}                                  |
  329.  --------------------------------------------------------------------------
  330.  
  331.      JPDoor needs to find MAPPED.TPU to perform some of its functions.
  332.   MAPPED.TPU is included in the JPDoor 3.1 distribution archive.  You
  333.   are not required to include it in your USES statement, however, it
  334.   must reside in your Turbo Pascal UNIT directory.
  335.  
  336.  
  337. Trapping HALT codes (exits):
  338. ----------------------------
  339.  
  340.      The include file TRAPEXIT.PAS contains a far call procedure called 
  341.   TRAPEXIT.  The TRAPEXIT procedure, in turn, calls a TERMINATE procedure
  342.   and passes the halt code to it.  You could conceivably do all your 
  343.   clean-up, etc. right inside of the TRAPEXIT procedure and not call 
  344.   another procedure such as TERMINATE but for the sake of demonstration,
  345.   let us say that the far call procedure TRAPEXIT does call the procedure
  346.   TERMINATE.
  347.  
  348.      First of all, let's get setup to trap HALT codes.  Here's what you'll 
  349.   need to do:
  350.  
  351.      1)  Incorporate the following TERMINATE procedure.  The TRAPEXIT
  352.          procedure will call this procedure, passing the HALT code to
  353.          it.  If the HALT is a runtime error, TRAPEXIT will report that
  354.          instead of calling TERMINATE.
  355.  
  356.  
  357.  
  358.  
  359.  
  360.  
  361.  
  362.  
  363.  
  364.  
  365.                                                         [6] JPDoor 3.1.Doc
  366.  
  367.  
  368. Trapping HALT codes (continued):
  369. --------------------------------
  370.  
  371.  -----------------------------------------------------------------------------
  372.  |  PROCEDURE Terminate(HaltCode : BYTE) ;                                   |
  373.  |  BEGIN                                                                    |
  374.  |     CASE HaltCode OF                                                      |
  375.  |        0 : WRITELN('Normal termination') ; {normal terminate - no action} |
  376.  |        1 : BEGIN                                                          |
  377.  |               WRITELN('Carrier lost') ;                                   |
  378.  |               EndGame ; {call EndGame proc. and write user info}          |
  379.  |            END ;                                                          |
  380.  |        2 : BEGIN                                                          |
  381.  |               WRITELN('Time limit exceeded') ;                            |
  382.  |               { do what you would want done if the caller's time          |
  383.  |                 limit was exceeded }                                      |
  384.  |            END ;                                                          |
  385.  |        3 : BEGIN                                                          |
  386.  |               WRITELN('User inactivity timeout') ;                        |
  387.  |               { do what you would want done if user was inactive }        |
  388.  |            END ;                                                          |
  389.  |        4 : BEGIN                                                          |
  390.  |               WRITELN('Dorinfo1.Def file not found') ;                    |
  391.  |               { not good - do what you would want done in this situation} |
  392.  |            END ;                                                          |
  393.  |        5 : BEGIN                                                          |
  394.  |               WRITELN('Exitinfo.Bbs file not found') ;                    |
  395.  |               { not good - do what you would want done in this situation} |
  396.  |            END ;                                                          |
  397.  |        6 : BEGIN                                                          |
  398.  |               WRITELN('Directory read/change error') ;                    |
  399.  |               { this is a nasty.  You should close files and HALT(0) }    |
  400.  |            END ;                                                          |
  401.  |        7 : BEGIN                                                          |
  402.  |               WRITELN('CTS - Clear To Send Error/Time Out');              |
  403.  |               { most likely carrier has been dropped, close files }       |
  404.  |               { and then Halt(0) }                                        |
  405.  |               END                                                         |
  406.  |        8 : WRITELN('RAXIT Semaphore forced Exit');                        |
  407.  |        9 : Writeln('Door.Sys file not found');
  408.  |     END ;                                                                 |
  409.  |   END ;                                                                   |
  410.   ---------------------------------------------------------------------------
  411.   
  412.  
  413.  
  414.  
  415.  
  416.  
  417.  
  418.  
  419.  
  420.  
  421.  
  422.  
  423.  
  424.  
  425.  
  426.                                                         [7] JPDoor 3.1.Doc
  427.  
  428.  
  429.  
  430. Trapping Halt Codes (continued):
  431. --------------------------------
  432.  
  433.          Place your TERMINATE procedure anywhere within your program.  The 
  434.          only stipulation is that you must place it BEFORE the line that
  435.          includes the file TRAPEXIT.PAS.
  436.  
  437.  
  438.      2)  Next, be sure to include the TrapExit.Pas file:
  439.       
  440.  ---------------------------------------------------------------------------
  441. |                            {$I TRAPEXIT}                                  | 
  442.  ---------------------------------------------------------------------------
  443.  
  444.  
  445.  
  446.      3)  Now, in the Main Body of your program code, you will need to add
  447.          the following line:
  448.  
  449.  ---------------------------------------------------------------------------
  450. |                      BEGIN   { Main - Example }                           |
  451. |                        ASSIGN(OutPut,'') ;                                |
  452. |                        REWRITE(OutPut) ;                                  |
  453. |                        DoorExit := TrapExit ;                             |
  454. |                      ......                                               |
  455. |                      ...                                                  |
  456. |                      your program continues                               |
  457.  ---------------------------------------------------------------------------
  458.  
  459.          The statements ASSIGN(OutPut,'') and REWRITE(OutPut) will allow
  460.          ANSI escape codes to be properly displayed on the local console.
  461.          The statement DoorExit := TrapExit will setup halt code trapping.
  462.  
  463.  
  464.  
  465.      Now HALT code trapping is in effect.  When a HALT code is encountered,
  466.   the TRAPEXIT procedure will be called.  TRAPEXIT will determine if a
  467.   Runtime Error has occurred or if a HALT code was used.  If a HALT code
  468.   was used, TRAPEXIT will call your program's TERMINATE procedure, passing
  469.   the HALT code to it.
  470.  
  471.      If you do not assign a procedure to DoorExit as shown, HALT codes will
  472.   not be trapped.
  473.  
  474.  
  475.  
  476.  
  477.  
  478.  
  479.  
  480.  
  481.  
  482.  
  483.  
  484.  
  485.  
  486.  
  487.                                                         [8]  JPDoor 3.1.Doc
  488.  
  489.  
  490.  
  491. Trapping Extended Keys:
  492. -----------------------
  493.  
  494.      JPDoor allows you to define up to 20 extended keys for Sysop/Local use
  495.   as well as 20 keys for End-User/Remote use.  This would allow the Sysop
  496.   to setup procedures that can be called at the press of an ALT key or 
  497.   Function key.  This would also be good for a door program that required
  498.   the end-user to press, for example, an up or down arrow key.
  499.  
  500.      Extended codes are codes that return a null (character #0) first, and 
  501.   then a second, extended code second.  For example, ALT-C is a two-code key.
  502.   It's a null (ASCII #0) code followed by an ASCII #46.
  503.  
  504.      Other codes are, for example, control codes such as CONTROL-R which 
  505.   is an ASCII #18.  This type of control code is not an extended code yet
  506.   you might want to trap for it and have a procedure called.
  507.  
  508.      So how do we setup to trap these keys?  For the sake of this example, 
  509.   let's say that our goal is to trap for an ALT-C.  Let's say that we want 
  510.   to call an online chat procedure called CHAT when ALT-C is pressed.
  511.  
  512.      The first thing we need to do is to tell JPDoor the key codes we want
  513.   to trap and the procedure name to call.  Since this is a Sysop/Local 
  514.   key/function we'll use SysopKey and SysopProc.  Let's define it as follows:
  515.  
  516.  
  517.  ---------------------------------------------------------------------------
  518. |                    SysopKey[1]  := #0 + #46 ;                             |
  519. |                    SysopProc[1] := ALT_C ;                                |
  520.  ---------------------------------------------------------------------------
  521.  
  522.  
  523.  
  524.      We can define up to 20 keys and procedures here but we'll just work with
  525.   this one.  Next, we'll need to set the unit variable 'SysopKeysOn' to TRUE:
  526.  
  527.  
  528.  ---------------------------------------------------------------------------
  529. |                    SysopKeysOn := TRUE ;                                  |
  530.  ---------------------------------------------------------------------------
  531.   
  532.  
  533.  
  534.  
  535.  
  536.  
  537.  
  538.  
  539.  
  540.  
  541.  
  542.  
  543.  
  544.  
  545.  
  546.  
  547.  
  548.                                                         [9] JPDoor 3.1.Doc
  549.  
  550.  
  551.  
  552. Trapping Extended Keys (continued):
  553. -----------------------------------
  554.           
  555.      Next, we need to take a look at our SYSOPKEY.PAS far call include file.
  556.   Here's what it might look like:
  557.  
  558.  
  559.  --------------------------------------------------------------------------
  560. |    {$F+}                                                                 |
  561. |    PROCEDURE ALT_C ;                                                     |
  562. |     BEGIN                                                                |
  563. |        SysopKeysOn := FALSE ; {turn off key trapping for the duration }  |
  564. |        CHAT ;                 {call your CHAT procedure in your code  }  |
  565. |        SysopKeysOn := TRUE ;  {turn key trapping back on              }  |
  566. |     END ;                                                                |
  567. |     {$F-}                                                                |
  568.  --------------------------------------------------------------------------
  569.  
  570.  
  571.      Pretty straight forward, isn't it?  The far call procedure ALT_C turns 
  572.   off key trapping (you don't want to be able to chat within CHAT do you?). 
  573.   It then calls your procedure called CHAT.  Lastly, it turns key trapping
  574.   back on again.  Your program will then continue where it was before ALT-C
  575.   was pressed.
  576.  
  577.  
  578.  
  579.   So how's our main program code segment looking so far?  Let's take a look:
  580.  
  581.  --------------------------------------------------------------------------
  582. |               {$I TRAPEXIT}                                              |
  583. |               {$I SYSOPKEY}                                              |
  584. |                                                                          |
  585. |               BEGIN   { Main - Example }                                 |
  586. |                  ASSIGN(OutPut,'') ;                                     |
  587. |                  REWRITE(OutPut) ;                                       |
  588. |                  DoorExit := TrapExit ;                                  |
  589. |                  SysopKey[1] := #0 + #46 ;                               |
  590. |                  SysopProc[1] := ALT_C ;                                 |
  591. |                  SysopKeysOn := TRUE ;                                   |
  592. |               ......                                                     |
  593. |               ...                                                        |
  594. |               your program continues                                     |
  595. |                                                                          |
  596.  --------------------------------------------------------------------------
  597.   
  598.  
  599.  
  600.  
  601.  
  602.  
  603.  
  604.  
  605.  
  606.  
  607.  
  608.  
  609.                                                         [10] JPDoor 3.1.Doc
  610.  
  611.  
  612. Trapping Extended Keys(continued):
  613. ----------------------------------
  614.  
  615.      Now if you wanted to enable a user to enter extended codes or control
  616.   codes, you use the same theory as with Sysop/Local keys only we work with
  617.   the variables UserKey[1..20], UserProc[1..20], and UserKeysOn (BOOLEAN).
  618.  
  619.      For example, let's say that we want our door program to allow the user
  620.   to press CONTROL-R to redraw the screen.  Let's say that you already have 
  621.   a procedure called REDRAW in your program.  Let's create a file called
  622.   USERKEY.PAS.  Here's what it might look like:
  623.  
  624.  --------------------------------------------------------------------------
  625. |                   {$F+}                                                  |
  626. |                   PROCEDURE CONTROL_R ;                                  |
  627. |                   BEGIN                                                  |
  628. |                      UserKeysOn := FALSE ;                               |
  629. |                      REDRAW ;                                            |
  630. |                      UserKeysOn := TRUE ;                                |
  631. |                   END ;                                                  |
  632. |                   {$F-}                                                  |
  633.  --------------------------------------------------------------------------
  634.  
  635.  
  636.      Now here's how your main program code might look:
  637.  
  638.  
  639.  --------------------------------------------------------------------------
  640. |                   {$I TRAPEXIT}                                          |
  641. |                   {$I SYSOPKEY}                                          |
  642. |                   {$I USERKEY}                                           |
  643. |                                                                          |
  644. |                   BEGIN   { Main - Example }                             |
  645. |                      ASSIGN(OutPut,'') ;                                 |
  646. |                      REWRITE(OutPut) ;                                   |
  647. |                      DoorExit := TrapExit ;                              |
  648. |                      SysopKey[1] := #0 + #46 ;                           |
  649. |                      SysopProc[1] := ALT_C ;                             |
  650. |                      SysopKeysOn := TRUE ;                               |
  651. |                      UserKey[1] := #18 ;                                 |
  652. |                      UserProc[1] := CONTROL_R ;                          |
  653. |                      UserKeysOn := TRUE ;                                |
  654. |                   .....                                                  |
  655. |                   ...                                                    |
  656. |                   your program continues                                 |
  657.  --------------------------------------------------------------------------
  658.  
  659.      It works the way the SysopKey/SysopProc does.  You can define up to 20
  660.   SysopKey, UserKey, SysopProc, and UserProc's.  There's no need to initialize
  661.   them.  Toggling SysopKeysOn and UserKeysOn TRUE/FALSE is all you need to
  662.   turn them on or off.
  663.  
  664.  
  665.  
  666.  
  667.  
  668.  
  669.  
  670.                                                         [11] JPDoor 3.1.Doc
  671.  
  672.  
  673. Getting the User Information:
  674. -----------------------------
  675.  
  676.      Now we're at a point where we can get the online user's information.
  677.   Previous versions of JPDoor required the presence of both a DORINFOx.DEF
  678.   and an EXITINFO.BBS file created which are created by RemoteAccess and
  679.   QuickBBS. Because many doors are used on a wide variety of BBS types,
  680.   and many of them are not capable of producing an Exitinfo.bbs, this is
  681.   now optional. If your door does not need to update any user information,
  682.   simply include the following in your program BEFORE calling GetDorinfo.
  683.           CkExitInfo := False;
  684.   Finally, JPDoor will now read a GAP style DOOR.SYS file as well as the
  685.   DOOR.SYS created by RemoteAccess. If you wish to use this file, rather
  686.   than DORINFOx.DEF then include the following BEFORE calling GetDorinfo.
  687.           DoorSys := True;
  688.   The GetDorinfo routine will automatically detect the correct structures
  689.   for any of these drop files:
  690.           QBBS 2.64 - 2.75 EXITINFO.BBS
  691.           RemoteAccess V0.03 - 1.11 EXITINFO.BBS
  692.           RemoteAccess V1.xx DOOR.SYS (DoorWay Style)
  693.           GAP DOOR.SYS (Also created with PCBoard)
  694.  
  695.   To get information about the user currently online, we must pass two
  696.   parameters to GetDorInfo.
  697.   They are:
  698.         1: the current node
  699.         2: the path to DORINFOx.DEF and EXITINFO.BBS or DOOR.SYS
  700.  
  701.      JPDoor is designed to support RemoteAccess 1.11 data structures.
  702.   However, if the program you create is run on a QuickBBS system,
  703.   or earlier releases of RemoteAccess, the EXITINFO.BBS file will be
  704.   converted automatically to RemoteAccess 1.11 format upon program startup.
  705.   It will also be automatically converted back to its original format when
  706.   your program ends.  No intervention or conversion is required by your
  707.   program!
  708.   So now let's add the GetDorInfo procedure to your program code:
  709.  
  710.  --------------------------------------------------------------------------
  711. |                     {$I TRAPEXIT}                                        |
  712. |                     {$I SYSOPKEY}                                        |
  713. |                     {$I USERKEY}                                         |
  714. |                                                                          |
  715. |                     BEGIN   { Main - Example }                           |
  716. |                        ASSIGN(OutPut,'') ;                               |
  717. |                        REWRITE(OutPut) ;                                 |
  718. |                        DoorExit := TrapExit ;                            |
  719. |                        SysopKey[1] := #0 + #46 ;                         |
  720. |                        SysopProc[1] := ALT_C ;                           |
  721. |                        SysopKeysOn := TRUE ;                             |
  722. |                        UserKey[1] := #18 ;                               |
  723. |                        UserProc[1] := CONTROL_R ;                        |
  724. |                        UserKeysOn := TRUE ;                              |
  725. |                        GetDorInfo(Node,'') ;                             |
  726. |                    ......                                                |
  727. |                    ....                                                  |
  728. |                    your program continues                                |
  729.  --------------------------------------------------------------------------
  730.  
  731.                                                         [12] JPDoor 3.1.Doc
  732.  
  733.  
  734. Getting the User Information: (Continued)
  735. -----------------------------------------
  736.  
  737.      This example uses the current directory as the directory to read
  738.   DORINFOx.DEF and EXITINFO.BBS from.  Once done, we have all the user
  739.   and FOSSIL port information needed by JPDoor.
  740.  
  741.  
  742. Initializing the FOSSIL Driver:
  743. -------------------------------
  744.  
  745.      This is really straight forward.  You should always use a FOSSIL driver
  746.   when executing a door program.  Whether or not you're local, you still
  747.   need one installed for proper I/O.  We're at a good spot in your main 
  748.   program segment to check/initialize the FOSSIL driver.  Let's add the 
  749.   following lines of code:
  750.  
  751.  --------------------------------------------------------------------------
  752. |                                                                          |
  753. |                IF NOT SetFossil THEN BEGIN                               |
  754. |                    WRITELN(#7,'WARNING!  Fossil not detected!') ;        |
  755. |                    HALT(0) ;                                             |
  756. |                END ELSE WRITELN('Fossil detected') ;                     |
  757.  --------------------------------------------------------------------------
  758.  
  759.      Of course you can use any halt code greater than ten instead of zero. 
  760.   What this block of code does is checks the value of the BOOLEAN function
  761.   'SetFossil'.  When referrenced, SetFossil calls an internal procedure 
  762.   which initializes the FOSSIL driver and returns a TRUE or FALSE depending
  763.   on its success.
  764.      Let's add this to your program code:
  765.  
  766.  -------------------------------------------------------------------------- 
  767. |                {$I TRAPEXIT}                                             |
  768. |                {$I SYSOPKEY}                                             |
  769. |                {$I USERKEY}                                              |
  770. |                                                                          |
  771. |                BEGIN   { Main - Example }                                |
  772. |                   ASSIGN(OutPut,'') ;                                    |
  773. |                   REWRITE(OutPut) ;                                      |
  774. |                   DoorExit := TrapExit ;                                 |
  775. |                   SysopKey[1] := #0 + #46 ;                              |
  776. |                   SysopProc[1] := ALT_C ;                                |
  777. |                   SysopKeysOn := TRUE ;                                  |
  778. |                   UserKey[1] := #18 ;                                    |
  779. |                   UserProc[1] := CONTROL_R ;                             |
  780. |                   UserKeysOn := TRUE ;                                   |
  781. |                   GetDorInfo(Node,'') ;                                  |
  782. |                   IF NOT SetFossil THEN BEGIN                            |
  783. |                      WRITELN(#7,'WARNING!  Fossil not detected!') ;      |
  784. |                      HALT(0) ;                                           |
  785. |                   END ELSE WRITELN('Fossil detected') ;                  |
  786. |                ......                                                    |
  787. |                ...                                                       |
  788. |                your program continues                                    |
  789.  --------------------------------------------------------------------------
  790.  
  791.                                                         [13] JPDoor 3.1.Doc
  792.  
  793.  
  794. Initializing ANSI Color Sequences:
  795. ----------------------------------
  796.  
  797.      Next we need to initialize ANSI colors.  Whether or not a user of your
  798.   program has ANSI turned on, you should still include this segment in your
  799.   program code.  If the user does not have ANSI turned on, the procedure
  800.   'SetColor' will exit without performing any tasks.
  801.  
  802.  --------------------------------------------------------------------------
  803. |                 {$I TRAPEXIT}                                            |
  804. |                 {$I SYSOPKEY}                                            |
  805. |                 {$I USERKEY}                                             |
  806. |                 BEGIN   { Main - Example }                               |
  807. |                    ASSIGN(OutPut,'') ;                                   |
  808. |                    REWRITE(OutPut) ;                                     |
  809. |                    DoorExit := TrapExit ;                                |
  810. |                    SysopKey[1] := #0 + #46 ;                             |
  811. |                    SysopProc[1] := ALT_C ;                               |
  812. |                    SysopKeysOn := TRUE ;                                 |
  813. |                    UserKey[1] := #18 ;                                   |
  814. |                    UserProc[1] := CONTROL_R ;                            |
  815. |                    UserKeysOn := TRUE ;                                  |
  816. |                    GetDorInfo(Node,'') ;                                 |
  817. |                    IF NOT SetFossil THEN BEGIN                           |
  818. |                        WRITELN(#7,'WARNING!  Fossil not detected!') ;    |
  819. |                        HALT(0) ;                                         |
  820. |                    END ELSE WRITELN('Fossil detected') ;                 |
  821. |                    SetColor(0,7,0) ;                                     |
  822. |                 ......                                                   |
  823. |                 ...                                                      |
  824. |                 your program continues                                   |
  825.  --------------------------------------------------------------------------
  826.  
  827. The Status Bar
  828. --------------
  829.  
  830.      JPDoor also provides a 2 line Status Bar at the bottom of the screen.
  831.   This is optional and may be turned on and off by you with the StatusLineOn
  832.   Boolean variable.
  833.  
  834.      You may also change the default display of the status bars simply by
  835.   putting your own info into the variables StatLineA[X] and StatLineB[X]
  836.   where X is a number from 1 to 9.  These coincide with funtion keys 1 - 9
  837.   and F-10 will turn OFF the status Bar. These variables are of type
  838.   String[79];
  839.  
  840.      The following codes are supported in the statusline string:
  841.  
  842.        ~C   Current Time
  843.        ~R   Time Remaining
  844.        ~S   Security Level
  845.        ~A   [ANSI] or [MONO]
  846.        ~B   Baud Rate
  847.  
  848.  
  849.      We have now included all the initialization functions that are required
  850.   by JPDoor.  Your program code can continue at this point!
  851.  
  852.                                                         [14] JPDoor 3.1.Doc
  853.  
  854.  
  855.  
  856. FOSSIL Output Buffering:
  857. ------------------------
  858.  
  859.      JPDoor supports hotkeys.  In order for JPDoor to act quickly when a 
  860.   hot-key is pressed, output buffering does not normally take place.  In 
  861.   other words, JPDoor will send out one character at a time to the FOSSIL
  862.   output buffer and wait until that character has been sent from the buffer
  863.   before sending another one.
  864.  
  865.      With programs written using JPDoor that do not utilize hot-keys, output
  866.   may be buffered which may increase the program's speed on the host computer.
  867.   If output buffering is used during a program which utilizes hot-keys, 
  868.   hot-keys will still function but there may be a delay before display is
  869.   interrupted after a valid hot-key is pressed.
  870.  
  871.      To turn on JPDoor's use of output buffering, you must set the DOS 
  872.   environment variable OUTBUFF to ON.   You can do this in a batch file
  873.   which calls the door program for which you want output buffering.
  874.  
  875.      Let's say we want to execute a door program that was compiled using
  876.   JPDoor.  In this example, the program is called DOORPROG.EXE.  Here's a
  877.   little batch file segment that calls DOORPROG.EXE:
  878.  
  879.      Menu Type 7 Optional Data Field Contents:
  880.  
  881.  
  882.               \COMMAND.COM /C \RA\MYDOOR.BAT
  883.  
  884.               MYDOOR.BAT:
  885.  
  886.               SET OUTBUFF=ON
  887.               DOORPROG.EXE
  888.               SET OUTBUFF=OFF
  889.  
  890.  
  891.      This batch file segment turns on JPDoor's output buffering, calls 
  892.   the door program DOORPROG.EXE, and then turns JPDoor's output buffering
  893.   off again before returning operation to the BBS.
  894.  
  895.  
  896.  
  897.  
  898.  
  899.  
  900.  
  901.  
  902.  
  903.  
  904.  
  905.  
  906.     
  907.  
  908.  
  909.  
  910.  
  911.  
  912.  
  913.                                                         [15] JPDoor 3.1.Doc
  914.  
  915.